package cz.muni.fi.pa165.api;

import cz.muni.fi.pa165.api.dto.MushroomDTO;
import cz.muni.fi.pa165.api.dto.MushroomDTO.Months;
import cz.muni.fi.pa165.api.dto.MushroomDTO.MushroomType;
import java.util.List;

/**
 * MushroomService interface provides a set of business methods for manipulation
 * and retrieval of mushrooms in form of DTO objects
 *
 * @author Marek Tuhársky
 */
public interface MushroomService {

    /*  Method to create mushroom
     * 
     * @param mushroomDTO - mushroom to be created
     * 
     * @throws DataAccessException - in case of any exception on a persistence layer
     */
    public void createMushroom(MushroomDTO mushroomDTO);

    /**
     * Retrieves a mushroom by id
     *
     * @param id Mushroom's id
     * @return DTO object representing mushroom with given id
     */
    public MushroomDTO getMushroom(Long id);

    /**
     * Updates a mushroom
     *
     * @param mushroomDTO Mushroom to be updated
     */
    public void updateMushroom(MushroomDTO mushroomDTO);

    /**
     * Removes a mushroom
     *
     * @param mushroomDTO Mushroom to be removed
     */
    public void removeMushroom(MushroomDTO mushroomDTO);

    /**
     * Retrieves all existing mushrooms
     *
     * @return List of all mushrooms
     */
    public List<MushroomDTO> findAllMushrooms();

    /**
     * Retrieves a mushroom with given name
     *
     * @param name Mushroom name
     * @return Mushroom with given name
     */
    public MushroomDTO findMushroomsByName(String name);

    /**
     * Retrieves all mushrooms with given name
     *
     * @param type Mushroom type
     * @return List of all mushrooms with given type
     */
    public List<MushroomDTO> findMushroomsByType(MushroomType type);

    /**
     * Retrieves all mushroom with given time area
     *
     * @param from starting point of area
     * @param to finishing point of area
     * @return List of all Mushrooms existing in this time area
     */
    public List<MushroomDTO> findMushroomsByOccurence(Months from, Months to);
}
